package com.jlesbegu.arkanoid;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URISyntaxException;

import android.util.Log;

public class TableModel {

	public static final int ROWS = 40;
	public static final int COLUMNS = 50;
	
	
	char[][] tableMatrix = new char[ROWS][COLUMNS];
	
	public char[][] getTableMatrix() {
		return tableMatrix;
	}

	public void setTableMatrix(char[][] tableMatrix) {
		this.tableMatrix = tableMatrix;
	}

	public TableModel(InputStream tableFile) throws URISyntaxException, IOException{
		
		BufferedReader reader = new BufferedReader(new InputStreamReader(tableFile));
		String line ="";
		int checkRows = 0;
		String log = "";
		while((line=reader.readLine()) != null && checkRows < ROWS){
			assert line.length() < COLUMNS;
			for(int i=0 ; i<line.length() ; i++){
				tableMatrix[checkRows][i] = line.charAt(i);
				log+=line.charAt(i)+"";
			}
			checkRows++;
			log+="\n";
			
		}
		
		Log.i("############# LOG : ", log);
	}

	
	
}
